/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_transaction_input_sale_detail")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionInputSaleDetail.findAll", query = "SELECT p FROM PosTransactionInputSaleDetail p"),
//    @NamedQuery(name = "PosTransactionInputSaleDetail.findBySync", query = "SELECT p FROM PosTransactionInputSaleDetail p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionInputSaleDetail.findBySaleDetailId", query = "SELECT p FROM PosTransactionInputSaleDetail p WHERE p.saleDetailId = :saleDetailId"),
//    @NamedQuery(name = "PosTransactionInputSaleDetail.findBySaleDetailQuantity", query = "SELECT p FROM PosTransactionInputSaleDetail p WHERE p.saleDetailQuantity = :saleDetailQuantity"),
//    @NamedQuery(name = "PosTransactionInputSaleDetail.findBySaleDetailPrice", query = "SELECT p FROM PosTransactionInputSaleDetail p WHERE p.saleDetailPrice = :saleDetailPrice"),
//    @NamedQuery(name = "PosTransactionInputSaleDetail.findBySaleDetailDiscountPercent", query = "SELECT p FROM PosTransactionInputSaleDetail p WHERE p.saleDetailDiscountPercent = :saleDetailDiscountPercent"),
//    @NamedQuery(name = "PosTransactionInputSaleDetail.findBySaleDetailDiscountNominal", query = "SELECT p FROM PosTransactionInputSaleDetail p WHERE p.saleDetailDiscountNominal = :saleDetailDiscountNominal"),
//    @NamedQuery(name = "PosTransactionInputSaleDetail.findBySaleDetailTotal", query = "SELECT p FROM PosTransactionInputSaleDetail p WHERE p.saleDetailTotal = :saleDetailTotal")})
public class PosTransactionInputSaleDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "sale_detail_id")
    private Integer saleDetailId;
    @Column(name = "sale_detail_quantity")
    private BigDecimal saleDetailQuantity;
    @Column(name = "sale_detail_price")
    private BigDecimal saleDetailPrice;
    @Column(name = "sale_detail_discount_percent")
    private BigDecimal saleDetailDiscountPercent;
    @Column(name = "sale_detail_discount_nominal")
    private BigDecimal saleDetailDiscountNominal;
    @Column(name = "sale_detail_total")
    private BigDecimal saleDetailTotal;
    @JoinColumn(name = "sale_detail_sale_id", referencedColumnName = "sale_id")
    @ManyToOne(optional = false)
    private PosTransactionInputSale saleDetailSaleId;
    @JoinColumn(name = "sale_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne(optional = false)
    private PosMasterItem saleDetailItemId;
    @JoinColumn(name = "sale_detail_price_outlet_id", referencedColumnName = "price_id")
    @ManyToOne(optional = false)
    private PosMasterPriceOutlet saleDetailPriceOutletId;
//    @JoinColumn(name = "sale_detail_satuan_id", referencedColumnName = "satuan_id")
//    @ManyToOne(optional = false)
//    private PosMasterSatuan saleDetailSatuanId;
    

    public PosTransactionInputSaleDetail() {
    }

    public PosTransactionInputSaleDetail(Integer saleDetailId) {
        this.saleDetailId = saleDetailId;
    }

    public PosTransactionInputSaleDetail(Integer saleDetailId, String sync) {
        this.saleDetailId = saleDetailId;
        this.sync = sync;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getSaleDetailId() {
        return saleDetailId;
    }

    public void setSaleDetailId(Integer saleDetailId) {
        this.saleDetailId = saleDetailId;
    }

    public BigDecimal getSaleDetailQuantity() {
        return saleDetailQuantity;
    }

    public void setSaleDetailQuantity(BigDecimal saleDetailQuantity) {
        this.saleDetailQuantity = saleDetailQuantity;
    }

    public BigDecimal getSaleDetailPrice() {
        return saleDetailPrice;
    }

    public void setSaleDetailPrice(BigDecimal saleDetailPrice) {
        this.saleDetailPrice = saleDetailPrice;
    }

    public BigDecimal getSaleDetailDiscountPercent() {
        return saleDetailDiscountPercent;
    }

    public void setSaleDetailDiscountPercent(BigDecimal saleDetailDiscountPercent) {
        this.saleDetailDiscountPercent = saleDetailDiscountPercent;
    }

    public BigDecimal getSaleDetailDiscountNominal() {
        return saleDetailDiscountNominal;
    }

    public void setSaleDetailDiscountNominal(BigDecimal saleDetailDiscountNominal) {
        this.saleDetailDiscountNominal = saleDetailDiscountNominal;
    }

    public BigDecimal getSaleDetailTotal() {
        return saleDetailTotal;
    }

    public void setSaleDetailTotal(BigDecimal saleDetailTotal) {
        this.saleDetailTotal = saleDetailTotal;
    }

    public PosTransactionInputSale getSaleDetailSaleId() {
        return saleDetailSaleId;
    }

    public void setSaleDetailSaleId(PosTransactionInputSale saleDetailSaleId) {
        this.saleDetailSaleId = saleDetailSaleId;
    }
//
//    public PosMasterIceCream getSaleDetailIceCreamId() {
//        return saleDetailIceCreamId;
//    }
//
//    public void setSaleDetailIceCreamId(PosMasterIceCream saleDetailIceCreamId) {
//        this.saleDetailIceCreamId = saleDetailIceCreamId;
//    }
//
//    public PosMasterPrice getSaleDetailPriceId() {
//        return saleDetailPriceId;
//    }
//
//    public void setSaleDetailPriceId(PosMasterPrice saleDetailPriceId) {
//        this.saleDetailPriceId = saleDetailPriceId;
//    }

    public PosMasterPriceOutlet getSaleDetailPriceOutletId() {
        return saleDetailPriceOutletId;
    }

    public void setSaleDetailPriceOutletId(PosMasterPriceOutlet saleDetailPriceOutletId) {
        this.saleDetailPriceOutletId = saleDetailPriceOutletId;
    }

    public PosMasterItem getSaleDetailItemId() {
        return saleDetailItemId;
    }

    public void setSaleDetailItemId(PosMasterItem saleDetailItemId) {
        this.saleDetailItemId = saleDetailItemId;
    }

//    public PosMasterSatuan getSaleDetailSatuanId() {
//        return saleDetailSatuanId;
//    }
//
//    public void setSaleDetailSatuanId(PosMasterSatuan saleDetailSatuanId) {
//        this.saleDetailSatuanId = saleDetailSatuanId;
//    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (saleDetailId != null ? saleDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionInputSaleDetail)) {
            return false;
        }
        PosTransactionInputSaleDetail other = (PosTransactionInputSaleDetail) object;
        if ((this.saleDetailId == null && other.saleDetailId != null) || (this.saleDetailId != null && !this.saleDetailId.equals(other.saleDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.ronsicecream.pos.entities.PosTransactionInputSaleDetail[ saleDetailId=" + saleDetailId + " ]";
    }
    
}
